<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>后台管理中心</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" th:href="@{/bower_components/bootstrap/dist/css/bootstrap.min.css}">
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="@{/bower_components/font-awesome/css/font-awesome.min.css}">
  <!-- Ionicons -->
  <link rel="stylesheet" th:href="@{/bower_components/Ionicons/css/ionicons.min.css}">
  <!-- Theme style -->
  <link rel="stylesheet" th:href="@{/dist/css/AdminLTE.css}">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
  <link rel="stylesheet"th:href="@{/dist/css/skins/skin-blue.min.css}">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
  <!--引入jquery-->
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
  </script>
  <!--设置iframe的高度-->
  <script type="text/javascript">
    $(function () {
      var hh=window.screen.availHeight;
      $('.content').css('height',hh+'px');
      function setIframeHeight(iframe) {
        if (iframe) {
          var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
          if (iframeWin.document.body) {
            iframe.height = iframeWin.document.getElementById('frameContent').scrollHeight +20 || iframeWin.document.body.scrollHeight;
          }
        }
      };
      var  iframe=$("#menuFrame");
      iframe.load=function () {
        setIframeHeight(iframe);
      }
    });


  </script>
  <!--  高亮-->
  <script>
    $(function(){
      $('.sidebar-menu li:not(.treeview) > a').on('click', function(){
        var $parent = $(this).parent().addClass('active');
        $parent.siblings('.treeview.active').find('> a').trigger('click');
        $parent.siblings().removeClass('active').find('li').removeClass('active');
      });

      $(window).on('load', function(){
        $('.sidebar-menu a').each(function(){
          if(this.href === window.location.href){
            $(this).parent().addClass('active')
                    .closest('.treeview-menu').addClass('.menu-open')
                    .closest('.treeview').addClass('active');
          }
        });
      });
    });
  </script>

</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <!-- Main Header -->
  <header class="main-header">

    <!-- Logo -->
    <a href="index2.html" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>L</b>ing</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>Hadwin</b>Ling</span>
    </a>

    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>
      <!-- Navbar Right Menu -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Account Menu -->
          <li class="dropdown" th:if="${session.currAdmin != null}">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
              <span class="glyphicon glyphicon-user"></span><span class="caret"></span></a>
            <ul class="dropdown-menu">
              <!--                        <li th:text="${session.currUser.getUserId()}"></li>-->
              <li><a th:href="@{/}">首页</a></li>
              <li role="separator" class="divider"></li>
              <li><a th:href="@{/admin/logout}">退出</a></li>
            </ul>
          </li>
          <!-- Control Sidebar Toggle Button -->

        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

      <!-- Sidebar Menu -->
      <ul class="sidebar-menu" data-widget="tree">

        <li>
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>管理员信息</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/account}" target="menuFrame"><i class="fa fa-circle-o"></i> 基本信息</a></li>
            <li><a th:href="@{/admin/password}" target="menuFrame"><i class="fa fa-circle-o"></i> 变更密码</a></li>
            <li th:if="${session.currAdmin.adminname eq ('admin')}"><a th:href="@{/admin/addAdmin}" target="menuFrame"><i class="fa fa-circle-o"></i> 新增管理员</a></li>
          </ul>
        </li>
        <li>
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>文章管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/article}" target="menuFrame"><i class="fa fa-circle-o"></i> 查看文章</a></li>
            <li><a th:href="@{/admin/addArticle}" target="menuFrame"><i class="fa fa-circle-o"></i> 发布文章</a></li>
          </ul>
        </li>
        <li >
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>美图管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/photo}" target="menuFrame"><i class="fa fa-circle-o"></i> 查看美图</a></li>
            <li><a th:href="@{/admin/addPhoto}"target="menuFrame"><i class="fa fa-circle-o"></i> 发布美图</a></li>
          </ul>
        </li>
        <li >
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>标签管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/tag}" target="menuFrame"><i class="fa fa-circle-o"></i> 查看标签</a></li>
            <li><a th:href="@{/admin/addTag}" target="menuFrame"><i class="fa fa-circle-o"></i> 发布标签</a></li>
          </ul>
        </li>


        <li >
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>每日一言</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/day}" target="menuFrame"><i class="fa fa-circle-o"></i> 每日一言</a></li>
            <li><a th:href="@{/admin/addDay}"target="menuFrame"><i class="fa fa-circle-o"></i> 发布每日一言</a></li>
          </ul>
        </li>

        <li >
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>公告管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/notice}" target="menuFrame"><i class="fa fa-circle-o"></i> 查看公告</a></li>
            <li><a th:href="@{/admin/addNotice}"target="menuFrame"><i class="fa fa-circle-o"></i> 发布公告</a></li>
          </ul>
        </li>

        <li >
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>日常管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a th:href="@{/admin/moneyTag}" target="menuFrame"><i class="fa fa-circle-o"></i> 查看日常</a></li>
            <li><a th:href="@{/admin/addMoneyTag}" target="menuFrame"><i class="fa fa-circle-o"></i> 记账</a></li>
          </ul>
        </li>


      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">


    <!-- Main content -->
    <section class="content container-fluid">

      <!--------------------------
        | Your Page Content Here |
        -------------------------->
      <!--我的主页-->
      <iframe id="menuFrame" name="menuFrame" th:src="@{/admin/account}" style="overflow:visible;" scrolling="no" frameborder="no" height="100%" width="100%"></iframe>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <!-- To the right -->
    <div class="pull-right hidden-xs">
      Anything you want
    </div>
    <!-- Default to the left -->
    <strong>Copyright &copy; 2016 <a href="#">Company</a>.</strong> All rights reserved.
  </footer>


  <!-- Add the sidebar's background. This div must be placed
  immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 3 -->
<script th:src="@{/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/dist/js/adminlte.min.js}"></script>

<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
</body>
</html>